"""
容器之间相互嵌套

"""


# 列表里面嵌套列表，跟字典
# listA=[
#     [12,34,12],
#     [25,56,12]
# ]
# for a in listA:
#     for b in a:
#         print(b)

# 联合主键是由多个字段组合而成的主键，用于唯一标识数据库表中的记录
ticket_information={
"G1569":["北京南","天津南","11月08日","18:06","18:39","00:33"],
"G1567":["北京南","天津南","11月08日","18:15","18:49","00:34"],
"G8917":["北京南","天津南","11月08日","18:20","19:19","00:59"],
"G203":["北京南","天津南","11月08日","18:35","19:09","00:34"]
}
# print("车次\t出发站\t到达站\t出发日期\t\t出发时间\t到达时间\t历时时长")
# for key,values in ticket_information.items():
#      print(key,*values,sep="\t")
#     # print(key,end="\t")
#     # for e in values:
#     #     print(e,end="\t")
#     # print()
# cc=input("请输入购买的车次：")
# if cc  in ticket_information:
#     ccr=input("请输入乘车人：")
# # print(ticket_information["G1569"][0])
# print(f"【12306】{ccr}购票成功,{ticket_information[cc][2]}{cc}次,{ticket_information[cc][0]}{ticket_information[cc][3]}开")





"----------------------------------------"

dictA={
    "G1569":["北京南","天津南","11月08日","18:06","18:39","00:33"],
    "G1567":["北京南","天津南","11月08日","18:15","18:49","00:34"],
    "G8917":["北京南","天津南","11月08日","18:20","19:19","00:59"],
    "G203":["北京南","天津南","11月08日","18:35","19:09","00:34"]
}

print("车次\t\t出发站\t到达站\t出发日期\t出发时间\t到达时间\t历时时长")
for key,value in dictA.items():
    print(key,*value,sep="\t")
    #     print(key,end="\t")
    #     for info in value:
    #         print(info,end= "\t")
    #     print()
#输入车次
che=input("请输入要购买的车次:")  #
if che  in dictA:
    che_ren=input("请输入乘车人姓名:")
    che_info=dictA[che]   #获取的车辆信息,是一个列表
    # print(che_info)
    print(f"[12306]{che_ren}购票成功,{che_info[2]}{che}次,{che_info[0]}{che_info[3]}开")







